package com.egg.mall.entity.sku.orders;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.egg.common.core.model.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


/**
 * <p>
 * 订单
 * </p>
 *
 * @author east
 * @since 2022-08-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "mall_sku_orders")
@ApiModel(value = "Order对象", description = "订单")
public class SkuOrders extends BaseEntity {


    @ApiModelProperty(value = "用户ID")
    @TableField(value = "user_id")
    private Long userId;

    @ApiModelProperty(value = "编码")
    @TableField(value = "orders_no")
    private String ordersNo;

    @ApiModelProperty(value = "总金额(分)")
    @TableField(value = "total_amount")
    private Long totalAmount;

    @ApiModelProperty(value = "总数量")
    @TableField(value = "total_quantity")
    private Integer totalQuantity;

    /**
     * @see com.egg.mall.enums.OrderStateEnum
     */
    @ApiModelProperty(value = "状态", notes = "com.egg.mall.enums.OrderStateEnum")
    @TableField(value = "state")
    private String state;

    @ApiModelProperty(value = "运费金额(分)")
    @TableField(value = "freight_amount")
    private Long freightAmount;

    @ApiModelProperty(value = "支付金额(分)")
    @TableField(value = "pay_amount")
    private Long payAmount;

    @Version
    @ApiModelProperty(value = "版本号", notes = "用于乐观锁,不对外使用")
    @TableField(value = "version")
    private Long version;

}
